﻿@{
    ViewBag.Title = "Form";
    Layout = "~/Views/Shared/_ManufactureList.cshtml";
}
<style type="text/css">
    .ui-jqgrid .table-bordered th {
        height: 52px !important;
    }
</style>
<script type="text/javascript">
    $(function () {
        initControl();
        gridList();
    });
    function initControl() {
        $('select').bindSelect();
    }
    function gridList() {
        var $gridList = $("#gridList");
        $gridList.dataGrid({
            url: "/BOM/Product/GetSingleQueryJson",
            height: $(window).height() - 134,
            colModel: [
                { label: '总成(系统)', name: 'DH', width: 140, align: 'left', sortable: false, frozen: true },
                { label: '总成(系统)名称', name: 'MC', width: 220, align: 'left', sortable: false, frozen: true },
                { label: '类', name: 'LEI', width: 60, align: 'left', sortable: false },
                { label: '特征', name: 'TX', width: 40, align: 'center', sortable: false },
                { label: '状态', name: 'ZT', width: 40, align: 'center', sortable: false },
                { label: '装配<br />路线', name: 'AssembleLine', width: 40, align: 'center', sortable: false },
                { label: '制造路线', name: 'MakeLine', width: 240, align: 'left', sortable: false },
                { label: '版本', name: 'BB', width: 40, align: 'center', sortable: false },
                { label: '版次', name: 'BC', width: 40, align: 'center', sortable: false },
                { label: '技术更改单编号', name: 'LXD', width: 120, align: 'center', sortable: false },
                { label: '参考图号', name: 'CTH', width: 120, align: 'left', sortable: false },
                { label: '图幅', name: 'TF', width: 60, align: 'center', sortable: false },
                { label: '重量', name: 'ZL', width: 60, align: 'center', sortable: false },
                { label: '材料代码', name: 'CLDM', width: 80, align: 'center', sortable: false },
                { label: '分级', name: 'JF', width: 80, align: 'center', sortable: false }
            ],
            pager: "#gridPager",
            sortname: 'DH asc',
            viewrecords: true,
            rownumWidth: 40,
            onSelectRow: function (rowid) {
                //alert(rowid);
                var rowData = $gridList.jqGrid('getRowData', rowid);
                //alert(rowData.FProductionTypeNO);
                $('#txtCurrDH').val(rowData.DH);
            },
            ondblClickRow: function (rowid) {
                var rowData = $gridList.jqGrid('getRowData', rowid);
                //alert(rowData.DH);
                $('#txtCurrDH').val(rowData.DH);
                show_selector();
            }
        });
        $gridList.jqGrid('setLabel', 0, '序号', 'rowNumberHeaderStyle');
        $gridList.jqGrid('setFrozenColumns');
        $("#btn_search").click(function () {
            $gridList.jqGrid('setGridParam', {
                postData: { number: $("#txtNumber").val(), name: $("#txtName").val(), assemble: $("#txtAssemble").val(), make: $("#txtMake").val() },
            }).trigger('reloadGrid');
            $('#txtCurrDH').val("");
        });
    }
    function btn_next() {
        var dh = $.trim($('#txtCurrDH').val());
        if (dh == "") {
            $.modalAlert('请先选择总成。', 'warning');
        } else {
            window.location.href = '/BOM/Product/SingleQueryNext?dh=' + dh;
        }
    }
    function btn_previous() {
        var dh = $.trim($('#txtCurrDH').val());
        if (dh == "") {
            $.modalAlert('请先选择总成。', 'warning');
        } else {
            window.location.href = '/BOM/Product/SingleQueryPrevious?dh=' + dh;
        }
    }
</script>
<div id="layout" style="height: 100%; width: 100%;">
    <form id="form1">
        <div style="padding: 12px 0 5px 0; padding-left: 15px; border-bottom: 1px solid #ccc; " class="line-table input-width-105">
            <div class="btn-group" style="margin-top:-9px;">
                总成编号<br /><input id="txtNumber" name="txtNumber" type="text" class="form-control" /> &nbsp;
            </div>
            <div class="btn-group" style="margin-top:-9px;">
                总成名称<br /><input id="txtName" name="txtName" type="text" class="form-control input-width-185" /> &nbsp;
            </div>
            <div class="btn-group" style="margin-top:-9px;">
                装配路线<br /><input id="txtAssemble" name="txtAssemble" type="text" class="form-control input-width-40" /> &nbsp;
            </div>
            <div class="btn-group" style="margin-top:-9px;">
                制造路线<br /><input id="txtMake" name="txtMake" type="text" class="form-control" /> &nbsp;
            </div>
            <div class="btn-group" style="">
                <a id="btn_search" class="btn btn-primary center-block" onclick=""><span class="glyphicon glyphicon-search"></span> 检索</a>
            </div>
            <div class="btn-group" style="float:right;">
                <a id="" class="btn btn-primary center-block" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span> 刷新</a>
                <a id="" class="btn btn-primary center-block disabled" onclick="" href="javascript:;"><span class="glyphicon glyphicon-th-list"></span> 目录</a>
                <a id="" class="btn btn-primary center-block" onclick="btn_next()"><span class="glyphicon glyphicon-plus"></span> 展开</a>
                <a id="" class="btn btn-primary center-block" onclick="btn_previous()"><span class="glyphicon glyphicon-minus"></span> 回归</a>                
                <a id="" class="btn btn-primary center-block disabled" onclick=""><span class="glyphicon glyphicon-download"></span> 导出</a>
            </div>
        </div>
    </form>
    <div style="">
        <input id="txtCurrDH" name="txtCurrDH" type="hidden" value="" />
        <table id="gridList"></table>
        <div id="gridPager"></div>
    </div>
</div>

